import django_filters
from apps.HttpTestcase.models import Module


class ModuleFilters(django_filters.rest_framework.FilterSet):
    """
    环境过滤
    """
    name = django_filters.CharFilter(field_name='name', lookup_expr='icontains')
    project = django_filters.CharFilter(field_name='project_id', lookup_expr='exact')

    class Meta:
        model = Module
        fields = ['name', 'project']
